package com.xiaoma.thread.wait.productcustomer;

/**
 * 参考https://blog.csdn.net/worldchinalee/article/details/83790790
 *
 * @author maj
 * @ClassName TestPC2
 * @Description
 * @date 2020-09-12 14:02
 */
public class TestPC2 {

  public static void main(String[] args) {
    SynStack ss = new SynStack();
    //生产者和消费者都持有一个容器
    Producer producer = new Producer(ss);
    Consumer consumer = new Consumer(ss);

    Thread t1 = new Thread(producer);
    t1.setName("1号");
    t1.start();

    Thread t6 = new Thread(consumer);
    t6.setName("6号");
    t6.start();

    Thread t7 = new Thread(consumer);
    t7.setName("7号");
    t7.start();

  }
}
